import { superviseInfoAPI } from "@api/superviseInfo";
import todoListAPI from "@/api/todoListApi.js"
import stateArr from '@/tools/state'

export default {
    getValueList({ commit }) {
        const stateKey = stateArr
        stateKey.forEach((item) => {
            superviseInfoAPI.getValueList({ vsCode: item, appId: '' }).then(res => {
                commit('setValueList', { key: item, value: res.data.map(m => ({ value: m.vsiKey, label: m.vsiValue })) } )
            })
        })
    },
    getUnhandledNum({ commit }) {
        const params = {
            "commonPageDTO":{
                "currentPage":1,
                "pageSize":10
            },
            "sortDTO":{
                "fieldName":"",
                "orderBy":""
            },
            "pageNum":1,
            "pageSize":10,
            // 查询待办状态的数据
            "condition":{"state":1}
        }
        todoListAPI.querylist(params).then(res => {
            commit('setUnhandledNum', res.data.total || 0 )
        })
    },
}
